//
//  BSUserProtocolInfromationView.m
//  SuoSiApp
//
//  Created by zhang on 16/4/29.
//  Copyright © 2016年 Ym. All rights reserved.
//

#import "BSUserProtocolInfromationView.h"

@interface BSUserProtocolInfromationView ()

@property (nonatomic, strong) UITextView *textView;


@end

@implementation BSUserProtocolInfromationView

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    UIWebView *webView = [[UIWebView alloc]initWithFrame:self.view.bounds];
    [self.view addSubview:webView];

    UIButton *backBT = BSButton;
    backBT.frame = CGRectMake((kScrenWidth - 50)/2, kScrenHeight - 40   , 50, 25);
    [backBT setTitle:@"返回" forState:(UIControlStateNormal)];
    [backBT setTitleColor:BSOrange forState:(UIControlStateNormal)];
    [backBT addTarget:self action:@selector(back) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:backBT];
    
    
    [self loadDocument:@"UserProtocol.pages" inView:webView];
    
}
#pragma mark 显示用户协议
-(void)loadDocument:(NSString*)documentName inView:(UIWebView*)webView

{
    
    
    
    NSString *path = [[NSBundle mainBundle] pathForResource:documentName ofType:nil];
    
    NSURL *url = [NSURL fileURLWithPath:path];
    
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    
    [webView loadRequest:request];
}
- (void)back{

    [self dismissViewControllerAnimated:YES completion:nil];

}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
